package kxml_calendar.Display;

import java.util.Vector;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.ImageItem;

import javax.microedition.lcdui.List;

import kxml_calendar.parser.KXmlCalendarParser;
import obj.LichHoc;

public class CalendarList extends List
{
	public CalendarList()
	{
		super("FITHOU EDU - Calendar", List.IMPLICIT);
		
		KXmlCalendarParser parser = new KXmlCalendarParser();
		
		try
		{
                        LichHoc tmp;
                        String imgPath = "\\media\\images\\Calendar _icon.png";
			Vector rssItems = parser.parse("http://localhost:51486/Public/Calendar/08b1.xml");
			
			for(int i = 0; i < rssItems.size(); i++)
			{
                            tmp = (LichHoc)rssItems.elementAt(i);
                            append(tmp.getsNgayhoc() + "-" + tmp.getsTenmonhoc() + "-" + tmp.getsTengiangvien() + "-" + tmp.getsTrangthai(), null);
				//append(((LichHoc)rssItems.elementAt(i)).getsNgayhoc(), null);
			}
		}
		catch(Exception e)
		{
			append("Error: " + e, null);
			
			e.printStackTrace();
		}
	}
}
